using ASP;
using HoWave.Common;
using HoWave.Data.Bll;
using HoWave.Web.Admin;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using Wuqi.Webdiyer;
public class Admin_MBF_UserGiftCardCategorySet : Admin, IRequiresSessionState
{
	protected TextBox txtKeywords;
	protected Button Button_Search;
	protected Repeater Repeater_Festival;
	protected AspNetPager AspNetPager1;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			try
			{
				if (!base.admin.CheckAdminPower(39))
				{
					base.WriteLog("Modidy", Language.GetAdminMsg("Log/Access", "0"), "MBF_UserGiftCardCategorySet");
					base.WriteRightErrMsg();
				}
				this.BindData();
			}
			catch (Exception ex)
			{
				this.WriteErrMsg("", "页面出错：" + ex.Message, Fetch.Referrer);
				base.WriteLog("数据加载失败", "进入页面", base.GetType().Module.ToString());
			}
		}
	}
	protected void Button_Search_Click(object sender, EventArgs e)
	{
		string str = this.txtKeywords.Text.Trim();
		base.Response.Redirect("MBF_UserGiftCardCategorySet.aspx?MenuID=5&MenuName=卡类管理&FileName=礼品卡类别管理&keywords=" + str);
	}
	protected void BindData()
	{
		string text = Fetch.Get("keywords");
		int num = Fetch.GetID("page");
		if (num == 0)
		{
			num = 1;
		}
		int pageSize = 20;
		string text2 = "";
		if (text != "")
		{
			this.txtKeywords.Text = text;
			text2 = text2 + " FestivalName like '%" + text + "%'";
		}
		DataSet ds = Blls.bllGiftCategory.PageOrderList(pageSize, num, "rowid", 0, text2);
		StaticFunApp.AspNetPage(num, pageSize, ds, this.Repeater_Festival, this.AspNetPager1);
	}
	protected string GetDelLink(object obj)
	{
		return string.Format("javascript:Deleteid({0})", obj);
	}
	protected string GetDate(object month, object day, object type)
	{
		string result;
		if (type.IsNull(new object[0]) == "1")
		{
			result = string.Format("{0}月{1}日", month, day);
		}
		else
		{
			result = "";
		}
		return result;
	}
}
